package ma.katrav.ws.service.impl;

import ma.katrav.oxm.model.Role;
import ma.katrav.oxm.model.User;
import ma.katrav.proxy.api.AuthentificationEaoManager;
import ma.katrav.ws.service.AuthentificationService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service("authentificationService")
public class AuthentificationServiceImpl implements AuthentificationService {

	protected static Logger logger = Logger.getLogger("service");
	
	//@Autowired @Qualifier("authentificationEAO")
	private AuthentificationEaoManager authentificationEAO;
	

	public User authenticat(String login, String password) {
		logger.debug("Received Authntification Service request");
		
		User user = new User(); //authentificationEAO.authenticat(login, password);
		user.setId(1111L);
		user.setLogin("login");
		user.setPassword("password");
		user.setNom("nom");
		user.setPrenom("prenom");
		Role role = new Role();
		role.setId(7777L);
		role.setRole("ADMIN");
		user.setRole(role);
		logger.debug("Response Authntification Service request");
		return user;
	}

}
